package com.my.study.lock;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.TimeUnit;

public class TestMySource {
    public static void main(String[] args) throws InterruptedException {
        MySource mySource = new MySource(new ArrayBlockingQueue<String>(10));

        new Thread(()->{
            mySource.myProd("test");
        },"AA").start();

        new Thread(()->{
            mySource.myConsumer();
        },"BB").start();

        TimeUnit.SECONDS.sleep(5);

        mySource.stop();
    }
}
